#ifndef __CURAND_TO_MCRAND_ADAPTOR_H__
#define __CURAND_TO_MCRAND_ADAPTOR_H__

// prevent including the real cuRAND header of CUDA
#ifndef CURAND_H_
#define CURAND_H_
#endif

#ifndef CURAND_KERNEL_H_
#define CURAND_KERNEL_H_
#endif

#ifndef CURANDDISCRETE_H_
#define CURANDDISCRETE_H_
#endif

#ifndef CURAND_DISCRETE_H_
#define CURAND_DISCRETE_H_
#endif

#ifndef CURAND_GLOBALS_H
#define CURAND_GLOBALS_H
#endif

#ifndef CURAND_LOGNORMAL_H_
#define CURAND_LOGNORMAL_H_
#endif

#ifndef CURAND_MRG32K3A_MATRICES_H_
#define CURAND_MRG32K3A_MATRICES_H_
#endif

#ifndef CURAND_MTGP32_HOST_H
#define CURAND_MTGP32_HOST_H
#endif

#ifndef CURAND_MTGP32_KERNEL_H
#define CURAND_MTGP32_KERNEL_H
#endif

#ifndef CURAND_MTGP32_H
#define CURAND_MTGP32_H
#endif

#ifndef CURAND_MTGP32DC_P_11213_H
#define CURAND_MTGP32DC_P_11213_H
#endif

#ifndef CURAND_NORMAL_STATIC_H
#define CURAND_NORMAL_STATIC_H
#endif

#ifndef CURAND_NORMAL_H_
#define CURAND_NORMAL_H_
#endif

#ifndef CURAND_PHILOX4X32_X__H_
#define CURAND_PHILOX4X32_X__H_
#endif

#ifndef CURAND_POISSON_H_
#define CURAND_POISSON_H_
#endif

#ifndef CURAND_XORWOW_PRECALCULATED_H_
#define CURAND_XORWOW_PRECALCULATED_H_
#endif

#ifndef CURAND_UNIFORM_H_
#define CURAND_UNIFORM_H_
#endif

// enum redefine in curand.h
#define CURAND_VER_MAJOR MCRAND_VER_MAJOR
#define CURAND_VER_MINOR MCRAND_VER_MINOR
#define CURAND_VER_PATCH MCRAND_VER_PATCH
#define CURAND_VER_BUILD MCRAND_VER_BUILD
#define CURAND_VERSION MCRAND_VERSION
#define CURAND_STATUS_SUCCESS MCRAND_STATUS_SUCCESS
#define CURAND_STATUS_VERSION_MISMATCH MCRAND_STATUS_VERSION_MISMATCH
#define CURAND_STATUS_NOT_INITIALIZED MCRAND_STATUS_NOT_INITIALIZED
#define CURAND_STATUS_ALLOCATION_FAILED MCRAND_STATUS_ALLOCATION_FAILED
#define CURAND_STATUS_TYPE_ERROR MCRAND_STATUS_TYPE_ERROR
#define CURAND_STATUS_OUT_OF_RANGE MCRAND_STATUS_OUT_OF_RANGE
#define CURAND_STATUS_LENGTH_NOT_MULTIPLE MCRAND_STATUS_LENGTH_NOT_MULTIPLE
#define CURAND_STATUS_DOUBLE_PRECISION_REQUIRED MCRAND_STATUS_DOUBLE_PRECISION_REQUIRED
#define CURAND_STATUS_LAUNCH_FAILURE MCRAND_STATUS_LAUNCH_FAILURE
#define CURAND_STATUS_PREEXISTING_FAILURE MCRAND_STATUS_PREEXISTING_FAILURE
#define CURAND_STATUS_INITIALIZATION_FAILED MCRAND_STATUS_INITIALIZATION_FAILED
#define CURAND_STATUS_ARCH_MISMATCH MCRAND_STATUS_ARCH_MISMATCH
#define CURAND_STATUS_INTERNAL_ERROR MCRAND_STATUS_INTERNAL_ERROR
#define CURAND_RNG_TEST MCRAND_RNG_TEST
#define CURAND_RNG_PSEUDO_DEFAULT MCRAND_RNG_PSEUDO_DEFAULT
#define CURAND_RNG_PSEUDO_XORWOW MCRAND_RNG_PSEUDO_XORWOW
#define CURAND_RNG_PSEUDO_MRG32K3A MCRAND_RNG_PSEUDO_MRG32K3A
#define CURAND_RNG_PSEUDO_MTGP32 MCRAND_RNG_PSEUDO_MTGP32
#define CURAND_RNG_PSEUDO_MT19937 MCRAND_RNG_PSEUDO_MT19937
#define CURAND_RNG_PSEUDO_PHILOX4_32_10 MCRAND_RNG_PSEUDO_PHILOX4_32_10
#define CURAND_RNG_QUASI_DEFAULT MCRAND_RNG_QUASI_DEFAULT
#define CURAND_RNG_QUASI_SOBOL32 MCRAND_RNG_QUASI_SOBOL32
#define CURAND_RNG_QUASI_SCRAMBLED_SOBOL32 MCRAND_RNG_QUASI_SCRAMBLED_SOBOL32
#define CURAND_RNG_QUASI_SOBOL64 MCRAND_RNG_QUASI_SOBOL64
#define CURAND_RNG_QUASI_SCRAMBLED_SOBOL64 MCRAND_RNG_QUASI_SCRAMBLED_SOBOL64
#define CURAND_ORDERING_PSEUDO_BEST MCRAND_ORDERING_PSEUDO_BEST
#define CURAND_ORDERING_PSEUDO_DEFAULT MCRAND_ORDERING_PSEUDO_DEFAULT
#define CURAND_ORDERING_PSEUDO_SEEDED MCRAND_ORDERING_PSEUDO_SEEDED
#define CURAND_ORDERING_PSEUDO_LEGACY MCRAND_ORDERING_PSEUDO_LEGACY
#define CURAND_ORDERING_PSEUDO_DYNAMIC MCRAND_ORDERING_PSEUDO_DYNAMIC
#define CURAND_ORDERING_QUASI_DEFAULT MCRAND_ORDERING_QUASI_DEFAULT
#define CURAND_DIRECTION_VECTORS_32_JOEKUO6 MCRAND_DIRECTION_VECTORS_32_JOEKUO6
#define CURAND_SCRAMBLED_DIRECTION_VECTORS_32_JOEKUO6 MCRAND_SCRAMBLED_DIRECTION_VECTORS_32_JOEKUO6
#define CURAND_DIRECTION_VECTORS_64_JOEKUO6 MCRAND_DIRECTION_VECTORS_64_JOEKUO6
#define CURAND_SCRAMBLED_DIRECTION_VECTORS_64_JOEKUO6 MCRAND_SCRAMBLED_DIRECTION_VECTORS_64_JOEKUO6
#define CURAND_CHOOSE_BEST MCRAND_CHOOSE_BEST
#define CURAND_ITR MCRAND_ITR
#define CURAND_KNUTH MCRAND_KNUTH
#define CURAND_HITR MCRAND_HITR
#define CURAND_M1 MCRAND_M1
#define CURAND_M2 MCRAND_M2
#define CURAND_BINARY_SEARCH MCRAND_BINARY_SEARCH
#define CURAND_DISCRETE_GAUSS MCRAND_DISCRETE_GAUSS
#define CURAND_REJECTION MCRAND_REJECTION
#define CURAND_DEVICE_API MCRAND_DEVICE_API
#define CURAND_FAST_REJECTION MCRAND_FAST_REJECTION
#define CURAND_3RD MCRAND_3RD
#define CURAND_DEFINITION MCRAND_DEFINITION
#define CURAND_POISSON MCRAND_POISSON

// data type redefine in curand.h
#define curandStatus_t mcrandStatus_t
#define curandStatus mcrandStatus
#define curandRngType_t mcrandRngType_t
#define curandRngType mcrandRngType
#define curandOrdering_t mcrandOrdering_t
#define curandOrdering mcrandOrdering
#define curandDirectionVectorSet_t mcrandDirectionVectorSet_t
#define curandDirectionVectorSet mcrandDirectionVectorSet
#define curandDirectionVectors32_t mcrandDirectionVectors32_t
#define curandDirectionVectors64_t mcrandDirectionVectors64_t
#define curandGenerator_st mcrandGenerator_st
#define curandGenerator_t mcrandGenerator_t
#define curandDistribution_st mcrandDistribution_st
#define curandDistribution_t mcrandDistribution_t
#define curandDistributionShift_st mcrandDistributionShift_st
#define curandDistributionShift_t mcrandDistributionShift_t
#define curandDistributionM2Shift_st mcrandDistributionM2Shift_st
#define curandDistributionM2Shift_t mcrandDistributionM2Shift_t
#define curandHistogramM2_st mcrandHistogramM2_st
#define curandHistogramM2_t mcrandHistogramM2_t
#define curandHistogramM2K_st mcrandHistogramM2K_st
#define curandHistogramM2K_t mcrandHistogramM2K_t
#define curandHistogramM2V_st mcrandHistogramM2V_st
#define curandHistogramM2V_t mcrandHistogramM2V_t
#define curandDiscreteDistribution_st mcrandDiscreteDistribution_st
#define curandDiscreteDistribution_t mcrandDiscreteDistribution_t
#define curandMethod_t mcrandMethod_t
#define curandMethod mcrandMethod

// data type redefine in curand_kernel.h
#define curandStateTest_t mcrandStateTest_t
#define curandStateTest mcrandStateTest
#define curandStateXORWOW_t mcrandStateXORWOW_t
#define curandStateXORWOW mcrandStateXORWOW
#define curandStateMRG32k3a_t mcrandStateMRG32k3a_t
#define curandStateMRG32k3a mcrandStateMRG32k3a
#define curandStateSobol32_t mcrandStateSobol32_t
#define curandStateSobol32 mcrandStateSobol32
#define curandStateScrambledSobol32_t mcrandStateScrambledSobol32_t
#define curandStateScrambledSobol32 mcrandStateScrambledSobol32
#define curandStateSobol64_t mcrandStateSobol64_t
#define curandStateSobol64 mcrandStateSobol64
#define curandStateScrambledSobol64_t mcrandStateScrambledSobol64_t
#define curandStateScrambledSobol64 mcrandStateScrambledSobol64
#define curandState_t mcrandState_t
#define curandState mcrandState
#define curandStatePhilox4_32_10_t mcrandStatePhilox4_32_10_t
#define curandStatePhilox4_32_10 mcrandStatePhilox4_32_10
#define curandStateMtgp32_t mcrandStateMtgp32_t
#define curandStateMtgp32 mcrandStateMtgp32
#define curand_MRG32k3a mcrand_MRG32k3a

// function redefine in curand.h
#define curandCreateGenerator mcrandCreateGenerator
#define curandCreateGeneratorHost mcrandCreateGeneratorHost
#define curandCreatePoissonDistribution mcrandCreatePoissonDistribution
#define curandDestroyDistribution mcrandDestroyDistribution
#define curandDestroyGenerator mcrandDestroyGenerator
#define curandGenerate mcrandGenerate
#define curandGenerateLogNormal mcrandGenerateLogNormal
#define curandGenerateLogNormalDouble mcrandGenerateLogNormalDouble
#define curandGenerateLongLong mcrandGenerateLongLong
#define curandGenerateNormal mcrandGenerateNormal
#define curandGenerateNormalDouble mcrandGenerateNormalDouble
#define curandGeneratePoisson mcrandGeneratePoisson
#define curandGenerateSeeds mcrandGenerateSeeds
#define curandGenerateUniform mcrandGenerateUniform
#define curandGenerateUniformDouble mcrandGenerateUniformDouble
#define curandGetDirectionVectors32 mcrandGetDirectionVectors32
#define curandGetDirectionVectors64 mcrandGetDirectionVectors64
#define curandGetScrambleConstants32 mcrandGetScrambleConstants32
#define curandGetScrambleConstants64 mcrandGetScrambleConstants64
#define curandGetVersion mcrandGetVersion
#define curandSetGeneratorOffset mcrandSetGeneratorOffset
#define curandSetGeneratorOrdering mcrandSetGeneratorOrdering
#define curandSetPseudoRandomGeneratorSeed mcrandSetPseudoRandomGeneratorSeed
#define curandSetQuasiRandomGeneratorDimensions mcrandSetQuasiRandomGeneratorDimensions
#define curandSetStream mcrandSetStream
// the following are just for internal usage
#define curandGetProperty mcrandGetProperty
#define curandGeneratePoissonMethod mcrandGeneratePoissonMethod
#define curandGenerateBinomial mcrandGenerateBinomial
#define curandGenerateBinomialMethod mcrandGenerateBinomialMethod

// function redefine in curand_kernel.h
#define curandMakeMTGP32Constants mcrandMakeMTGP32Constants
#define curandMakeMTGP32KernelState mcrandMakeMTGP32KernelState
#define curand_init mcrand_init
#define curand_log_normal mcrand_log_normal
#define curand_log_normal2 mcrand_log_normal2
#define curand_log_normal2_double mcrand_log_normal2_double
#define curand_log_normal4 mcrand_log_normal4
#define curand_log_normal_double mcrand_log_normal_double
#define curand_mtgp32_single mcrand_mtgp32_single
#define curand_mtgp32_single_specific mcrand_mtgp32_single_specific
#define curand_mtgp32_specific mcrand_mtgp32_specific
#define curand_normal mcrand_normal
#define curand_normal2 mcrand_normal2
#define curand_normal2_double mcrand_normal2_double
#define curand_normal4 mcrand_normal4
#define curand_normal_double mcrand_normal_double
#define curand_poisson mcrand_poisson
#define curand_poisson4 mcrand_poisson4
#define curand_uniform mcrand_uniform
#define curand_uniform2_double mcrand_uniform2_double
#define curand_uniform4 mcrand_uniform4
#define curand_uniform_double mcrand_uniform_double
#define curand_discrete mcrand_discrete
#define curand4 mcrand4
#define curand mcrand

// namespace redefine
#define curand_detail detail

#define CURANDAPI MCRANDAPI
#endif // __CURAND_TO_MCRAND_ADAPTOR_H__

